
export default {
    data: () => ({
        bhlxList:[],
        chjgList:[],
        bhgsList:[],
    }),
    computed: {
        
    },
    methods: {
        getBhDicListList:function(typecode){     //获取字典中的字段  
            var that = this;
            this.$post(this.$store.getters['api/commonreq'].getdictinfo,{typecode:typecode},function(data){
                if(typecode === 'bhlx'){
                    that.bhlxList = data;
                    window.sessionStorage.setItem('bhlxList',JSON.stringify(that.bhlxList));
                } else if(typecode === 'chjg'){
                    that.chjgList = data;
                    window.sessionStorage.setItem('chjgList',JSON.stringify(that.chjgList));
                } else if(typecode === 'bhgs'){
                    that.bhgsList = data;
                    window.sessionStorage.setItem('bhgsList',JSON.stringify(that.bhgsList));
                }
            })
        },

    },
    mounted() {
        let bhlx = JSON.parse(window.sessionStorage.getItem('bhlxList')) ? JSON.parse(window.sessionStorage.getItem('bhlxList')) : [];
        let chjg = JSON.parse(window.sessionStorage.getItem('chjgList')) ? JSON.parse(window.sessionStorage.getItem('chjgList')) : [];
        let bhgs = JSON.parse(window.sessionStorage.getItem('bhgsList')) ? JSON.parse(window.sessionStorage.getItem('bhgsList')) : [];
        if(bhlx.length > 0 && chjg.length > 0 && bhgs.length > 0) {
            this.bhlxList = bhlx;
            this.chjgList = chjg;
            this.bhgsList = bhgs;
        }else{
            this.getBhDicListList('bhlx');
            this.getBhDicListList('chjg');
            this.getBhDicListList('bhgs');
        }
    }


}
